package com.yanqu.road.logic.bussiness.player;

import com.yanqu.road.entity.activity.*;
import com.yanqu.road.entity.activity.starlight.StarLightMallRecord;
import com.yanqu.road.entity.player.UserActivityScore;
import com.yanqu.road.entity.player.UserMallBuyCount;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class UserActivityBussiness {
	public static Map<Integer, List<UserActivityConditionData>> getUserActivityConditionDataMap(long userId, List<Integer> activityIdList) {
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataMap(userId, activityIdList);
	}

	public static List<UserActivityConditionData> getUserActivityConditionDataList(int activityId, int rankNum){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataList(activityId, rankNum);
	}

	public static List<UserActivityConditionData> getUserActivityConditionDataListByType(int activityId, int conditionType){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataListByType(activityId, conditionType);
	}

	public static List<UserActivityConditionData> getUserActivityConditionDataListByUserIdAndType(int activityId,long userId, int conditionType){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataListByUserIdAndType(activityId,userId, conditionType);
	}

	public static List<UserActivityConditionData> getUserActivityConditionDataList(int activityId, int conditionType, int rankNum){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataList(activityId, conditionType, rankNum);
	}

	/**
	 * 冲榜活动适用
	 */
	public static UserActivityConditionData getUserActivityConditionData(int activityId, long userId){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionData(activityId, userId);
	}

	public static Map<Integer, Map<Long, Map<Integer, List<UserActivityConditionData>>>> getActivityAllConditionData(List<Integer> activityIds) {
		return DaoHelper.getUserActivityDaoImpl().getActivityAllConditionData(activityIds);
	}

	/**
	 * 商会冲榜
	 */
	public static Map<Long, UserActivityConditionData> getUnionActivityUserConditionDataMap(int activityId){
		return DaoHelper.getUserActivityDaoImpl().getUnionActivityUserConditionDataMap(activityId);
	}

	/**
	 * 非冲榜活动
	 */
	public static UserActivityConditionData getUserActivityConditionData(int activityId, long userId, int conditionId){
		return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionData(activityId, userId, conditionId);
	}

	public static boolean addUserActivityConditionData(UserActivityConditionData userActivityConditionData) {
		return DaoHelper.getUserActivityDaoImpl().add(userActivityConditionData);
	}

	public static boolean updateUserActivityConditionData(UserActivityConditionData userActivityConditionData) {
		return DaoHelper.getUserActivityDaoImpl().update(userActivityConditionData);
	}

	public static boolean updateUserActivityConditionDataState(UserActivityConditionData userActivityConditionData) {
		return DaoHelper.getUserActivityDaoImpl().updateUserActivityConditionDataState(userActivityConditionData);
	}

	public static LinkedList<TurntableLotteryRecord> getTurntableLotteryRecordList(int maxCount){
		return DaoHelper.getTurntableRecordDaoImpl().getTurntableLotteryRecordList(maxCount);
	}

	public static boolean addTurntableLotteryRecord(TurntableLotteryRecord turntableLotteryRecord) {
		return DaoHelper.getTurntableRecordDaoImpl().add(turntableLotteryRecord);
	}

	public static boolean updateTurntableLotteryRecord(TurntableLotteryRecord turntableLotteryRecord) {
		return DaoHelper.getTurntableRecordDaoImpl().update(turntableLotteryRecord);
	}

	public static Map<Integer, ActivityDetail> getActivityDetailMap(){
		return DaoHelper.getActivityDetailDaoImpl().getActivityDetailMap();
	}

	public static Map<Integer, ActivityDetail> getCrossActivityDetailMap(){
		return DaoHelper.getActivityDetailDaoImpl().getCrossActivityDetailMap();
	}

	public static boolean addActivityDetail(ActivityDetail activityDetail) {
		return DaoHelper.getActivityDetailDaoImpl().add(activityDetail);
	}

	public static boolean addCrossActivityDetail(ActivityDetail activityDetail) {
		return DaoHelper.getActivityDetailDaoImpl().addCrossData(activityDetail);
	}

	public static boolean updateActivityDetail(ActivityDetail activityDetail) {
		return DaoHelper.getActivityDetailDaoImpl().update(activityDetail);
	}

	public static boolean updateCrossActivityDetail(ActivityDetail activityDetail) {
		return DaoHelper.getActivityDetailDaoImpl().updateCrossData(activityDetail);
	}

	public static Map<String, UnionActivityConditionData> getUnionActivityConditionDataMap(int activityId){
		return DaoHelper.getUnionActivityDaoImpl().getUnionActivityConditionDataMap(activityId);
	}

	public static Map<String, UnionActivityConditionData> getUnionActivityConditionDataMap(int activityId,int conditionType){
		return DaoHelper.getUnionActivityDaoImpl().getUnionActivityConditionDataMap(activityId,conditionType);
	}

	public static boolean addUnionActivityConditionData(UnionActivityConditionData unionActivityConditionData) {
		return DaoHelper.getUnionActivityDaoImpl().add(unionActivityConditionData);
	}

	public static boolean updateUnionActivityConditionData(UnionActivityConditionData unionActivityConditionData) {
		return DaoHelper.getUnionActivityDaoImpl().update(unionActivityConditionData);
	}

	public static Map<Integer, UserMallBuyCount> getUserMallBuyCountMap(long userId) {
		return DaoHelper.getUserActivityMallBuyCountImpl().getUserMallBuyCountMap(userId);
	}

	public static boolean addUserMallBuyCount(UserMallBuyCount userMallBuyCount) {
		return DaoHelper.getUserActivityMallBuyCountImpl().add(userMallBuyCount);
	}

	public static boolean updateUserMallBuyCount(UserMallBuyCount userMallBuyCount) {
		return DaoHelper.getUserActivityMallBuyCountImpl().update(userMallBuyCount);
	}

	public static Map<Integer, Map<Integer, UserActivityScore>> getUserActivityScoreMap(long userId) {
		return DaoHelper.getUserActivityScoreDaoImpl().getUserActivityScoreMap(userId);
	}

	public static boolean addUserActivityScore(UserActivityScore userActivityScore) {
		return DaoHelper.getUserActivityScoreDaoImpl().add(userActivityScore);
	}

	public static boolean updateUserActivityScore(UserActivityScore userActivityScore) {
		return DaoHelper.getUserActivityScoreDaoImpl().update(userActivityScore);
	}

	public static boolean batchAddUserActivityConditionData(List<UserActivityConditionData> tempAddUserActivityConditionDatas) {
		return DaoHelper.getUserActivityDaoImpl().batchAdd(tempAddUserActivityConditionDatas);
	}
}
